using System;
using Jink.Protocol.Core.Verbs;
using Jink.Protocol.Extensibility;
using XenoGears.Reflection.Attributes.Snippets;

namespace Jink.Core.Handlers.Annotations
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
    [SnippetAnnotationAnnotation(AssemblyMarker = typeof(JinkExtensibilityAttribute), TypeMarker = typeof(HandlerAttribute))]
    public class HandlesAttribute : Attribute
    {
        public Verb Verb { get; private set; }
        public String UriTemplate { get; private set; }

        public HandlesAttribute(Verb verb, String uriTemplate)
        {
            Verb = verb;
            UriTemplate = uriTemplate;
        }

        public override String ToString()
        {
            return String.Format("{0} {1}", Verb.ToString().ToUpper(), UriTemplate);
        }
    }
}